package com.telit.firecommand.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.telit.firecommand.dto.CommMsgCenterLog;
import com.telit.firecommand.dto.QueryMsgCenterDTO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface CommMsgCenterLogDao extends BaseMapper<CommMsgCenterLog> {

    /**
     * 分页查询消息
     *
     * @param commMsgCenterLogIPage
     * @param queryMsgCenterDTO
     *
     * @return
     */
    IPage<CommMsgCenterLog> listByCondition(IPage<CommMsgCenterLog> commMsgCenterLogIPage,
                                            @Param("queryMsgCenter") QueryMsgCenterDTO queryMsgCenterDTO);

    /**
     * 批量更改状态
     *
     * @param status
     * @param ids
     *
     * @return
     */
    int updateStatusBatch(@Param("status") String status, @Param("ids") List<Long> ids);

    /**
     * 批量新增
     *
     * @return
     */
    int addBatch(@Param("list") List<CommMsgCenterLog> commMsgCenterLogList);

    /**
     * 消息总条数
     *
     * @param queryMsgCenterDTO
     *
     * @return
     */
    int listCount(@Param("queryMsgCenter") QueryMsgCenterDTO queryMsgCenterDTO);

}